chore(billing): claim the Play purchase hand-over - #283
Merged
Conversation
The endpoint was written before the idempotency plugin was on main and carried a note to come back for it. A retried hand-over was already harmless - the sync writes absolute state onto one row per account - but the claim spares a second verification round trip to Google, and this is exactly the call a phone retries: it fires the moment the app comes back from the Play sheet.
|
🎉 This PR is included in version 1.27.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /billing/play/purchasesnow carriesidempotency: true. It was written before that plugin was onmainand left with a note to come back for it; this is that.Root cause
Nothing was broken. A retried hand-over was already harmless — the sync writes the provider's absolute state onto one row per account, so reporting the same purchase twice lands in the same place. What the claim adds is that the second attempt no longer costs a verification round trip to Google, and this is precisely the call a phone retries: it fires the moment the app comes back from the Play sheet, which is also the moment the connection is least reliable.
Tests
Unit suite unchanged and passing (1532);
tsc -p tsconfig.build.json --noEmit,eslint,prettier --checkclean. The behaviour is covered by the existing idempotency e2e — this only adds a route to the set that opts in.AI Asistan: Opus 5